package com.yh.correct.service.impl;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yh.correct.dao.IMonthTestMapper;
import com.yh.correct.model.MonthTest;
import com.yh.correct.model.Page;
import com.yh.correct.service.IMonthTestService;

/** 
* @author 刘文涛  E-mail: 894516860@qq.com
* @version 创建时间：2017年3月7日 下午 3:35:15
* 月度考核记录业务层接口实现类
*/

@Service("monthtestservice")
public class MonthTestServiceImpl implements IMonthTestService {
	
	@Autowired
	private IMonthTestMapper monthTestMapper;
	
	@Override
	public Page getLikeMonthTest(Map<String, Object> condition) {
		Page page=new Page();
		page.setTotalNum(monthTestMapper.getLikeMonthTestCount(condition));
		int pageSize = Integer.parseInt(String.valueOf(condition.get("pageSize")));
		page.setPageSize(pageSize);
		int curPageNum = Integer.parseInt(String.valueOf(condition.get("pageNum")));
		page.setCurPageNum(curPageNum);
		page.setTotalPage(page.getTotalNum()/pageSize+(page.getTotalNum()%pageSize==0?0:1));
		page.setResult(monthTestMapper.getLikeMonthTest(condition));
		return page;
	}

	@Override
	public int addMonthTest(MonthTest monthtest) {
		return monthTestMapper.addMonthTest(monthtest);
	}

	@Override
	public int delMonthTest(MonthTest monthtest) {
		return monthTestMapper.delMonthTest(monthtest);
	}

	@Override
	public int updateMonthTest(MonthTest monthtest) {
		return monthTestMapper.updateMonthTest(monthtest);
	}

	@Override
	public Map<String, Object> getMonthTestById(MonthTest monthtest) {
		return monthTestMapper.getMonthTestById(monthtest);
	}

	@Override
	public List<Map<String, Object>> getAllMonthTest() {
		return monthTestMapper.getAllMonthTest();
	}

	@Override
	public List<Map<String, Object>> selectLabourList(Map<String,Object> map) {
		return monthTestMapper.selectLabourList(map);
	}

	@Override
	public List<Map<String, Object>> selectReportList(Map<String,Object> map) {
		return monthTestMapper.selectReportList(map);
	}

	@Override
	public List<Map<String, Object>> selectThoughtList(Map<String,Object> map) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectThoughtList(map);
	}

	@Override
	public List<Map<String, Object>> selectBonusList(Map<String,Object> map) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectBonusList(map);
	}

	@Override
	public List<Map<String, Object>> selectPointsList(Map<String,Object> map) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectPointsList(map);
	}

	@Override
	public Integer selectIsExist(Map<String, Object> map) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectIsExist(map);
	}

	@Override
	public Integer selectThoughtTimes(String month) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectThoughtTimes(month);
	}

	@Override
	public Integer selectLabourTimes(String month) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectLabourTimes(month);
	}

	@Override
	public Integer selectReportTimes(String month) {
		// TODO 自动生成的方法存根
		return monthTestMapper.selectReportTimes(month);
	}


}
